﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" CodeBehind="CustomHelper.aspx.cs"
    Inherits="HTMLHelpers.Views.CustomHelpers.CustomHelper" %>
<%@ Import Namespace="HTMLHelpers.Helpers"%>
    
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Book List with custom helper
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Book List with custom helper</h2>

    <table>
    <tr>
        <td>Id</td>
        <td>Title</td>
        <td>&nbsp;</td>
    </tr>
    <% int rowIndex = 0;
        foreach (var book in ViewData.Model)
       {%>
        <tr style="<%=Html.AlternateRowColor(rowIndex++, "Yellow") %>">
           <td><%=book.Id %></td>
           <td><%=book.Title %></td>
           <td><%=WriteDetailsLink(book)%></td>
       </tr>
    <% } %>
    </table>

</asp:Content>